package com.broada.apm.indicator.api.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.broada.apm.dao.TransactionDao;
import com.broada.apm.indicator.api.TransactionService;
import com.broada.apm.model.TransactionChannel;
import com.broada.apm.model.TransactionType;

public class TransactionServiceImpl implements TransactionService {
	
	@Autowired 
	TransactionDao transactionDao;

	@Override
	public void saveTransactionChannel(TransactionChannel transactionChannel) {
		transactionDao.addTransactionChannel(transactionChannel);
	}

	@Override
	public void saveTransactionType(TransactionType transactionType) {
		transactionDao.addTransactionType(transactionType);
	}

	@Override
	public List<TransactionChannel> getTransactionChannelByAppId(String appId) {
		return transactionDao.getTransactionChannelByAppId(appId);
	}

	@Override
	public List<TransactionType> getTransactionTypeByAppId(String appId) {
		return transactionDao.getTransactionTypeByAppId(appId);
	}

	@Override
	public List<TransactionType> getTypeByCondition(TransactionType transactionType) {
		return transactionDao.getTypeByCondition(transactionType);
	}

	@Override
	public List<TransactionChannel> getChannelByCondition(TransactionChannel transactionChannel) {
		return transactionDao.getChannelByCondition(transactionChannel);
	}

	@Override
	public List<String> getServiceIdByL7SubProto(TransactionType transactionType) {
		return transactionDao.getServiceIdByL7SubProto(transactionType);
	}

	@Override
	public void saveServiceL7Proto(TransactionType transactionType) {
		transactionDao.addServiceTransactionTypeMap(transactionType);
	}

	@Override
	public void updateTransactionChannel(TransactionChannel transactionChannel) {
		transactionDao.updateTransactionChannel(transactionChannel);
	}

	@Override
	public void updateTransactionType(TransactionType transactionType) {
		transactionDao.updateTransactionType(transactionType);
	}

}
